import request from '@/api/request'
import g from "@/utils/utilFn";
export function getlist(param) {
    param = g.objEngraving({
        start: "",
        end: "",
        Game: "",
        Chan: "",
        Account: "",
        PayUse: "",
        Residue_s: "",
        Residue_e: "",
        Phone: "",
        Area: "",
        Money_s: "",
        Money_e: "",
        source: "",
        page: 1,
        limit: 10,
        filed: "ID",
        sort: "descending",
    }, param || {})
    let data = new FormData()
    Object.keys(param).map((key) => {
        data.append(key, param[key] || "");
    });
    return request({
        url: '/recharge_account/getlist',
        method: 'POST',
        data
    })
}

export function remove_by_id(id) {
    let data = new FormData()
    data.append("id", id || "");
    return request({
        url: '/recharge_account/delete_by_id',
        method: 'POST',
        data
    })
}

export function notExistAdd(param) {
    param = g.objEngraving({
        Game: "",
        Chan: "",
        Account: "",
        Discount: "",
        PayUse: "",
        Money: "",
        Residue: "",
        source: "",
        Store: "",
        Phone: "",
        device: "",
        Area: "",
        Imei: "",
        Rehcarge_Time: ""
    }, param || {})
    let data = new FormData()
    Object.keys(param).map((key) => {
        data.append(key, param[key] || "");
    });
    return request({
        url: '/recharge_account/notExistAdd',
        method: 'POST',
        data
    })
}
export function update(param) {
    param = g.objEngraving({
        ID: "",
        Game: "",
        Chan: "",
        Account: "",
        Discount: "",
        PayUse: "",
        Money: "",
        Residue: "",
        source: "",
        Store: "",
        Phone: "",
        device: "",
        Area: "",
        Imei: "",
        Rehcarge_Time: ""
    }, param || {})
    let data = new FormData()
    Object.keys(param).map((key) => {
        data.append(key, param[key] || "");
    });
    return request({
        url: '/recharge_account/update',
        method: 'POST',
        data
    })
}
export function getlist4down(param) {
    param = g.objEngraving({
        start: "",
        end: "",
        Game: "",
        Chan: "",
        Account: "",
        PayUse: "",
        Residue_s: "",
        Residue_e: "",
        Phone: "",
        Area: "",
        Money_s: "",
        Money_e: "",
        source: "",
    }, param || {})
    let data = new FormData()
    Object.keys(param).map((key) => {
        data.append(key, param[key] || "");
    });
    return request({
        url: '/recharge_account/getlist4down',
        method: 'POST',
        data
    })
}